import page
from page.page_in import PageIn
from tools.get_driver import GetDriver


class TestYxWriteLetter:

    # 1.初始化
    def setup_class(self):
        # 1.获取driver
        driver = GetDriver.get_web_driver(page.qq_mail_url)
        # 2.获取统一入口类对象
        self.page_in = PageIn(driver)
        self.page_in.page_get_PageSyLogin().page_sy_login_success()
        self.write_letter = self.page_in.page_get_PageMailWriteLetter()

    # 2.结束
    def teardown_class(self):
        GetDriver.quit_web_driver()

    # 3.测试邮箱写信方法
    def test_yx_write_letter(self, recipient='1157534500@qq.com', subject='主题', content='内容'):
        self.write_letter.page_write_letter(recipient, subject, content)
        print('发布文章结果为：', self.write_letter.page_get_info())
